﻿@using SwdPageRecorder.UI;
@using SwdPageRecorder.UI.CodeGeneration

@functions{
    string QuoteLocator(string locator)
    {
        locator = locator.Replace("\"", "\"\"");
        locator = locator.Replace("{", "{{");
        locator = locator.Replace("}", "}}");
        return locator;
    }
}

public static class @Raw(@Model.PageObject.PageObjectName)
{
    @foreach (var element in @Model.PageObject.Items ) 
    {
        <text>
            public const string @Raw(@element.Name)_@Raw(@element.How)=@@"@Raw(@QuoteLocator(@element.Locator))";
        </text>
    }
}